<%@ page language="java" contentType="text/html; charset=utf-8" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s"  uri="/struts-tags" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <link href="assets/css/style.css" rel="stylesheet"/>
    <link href="assets/css/content-box/content-box.css" rel="stylesheet"/>
    <script type="text/javascript" src="assets/js/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="assets/js/content-box/content-box.js"></script><style type="text/css">
            body {
                padding-top:60px;
                padding-bottom:40px;
            }
        </style>
  </head>
  
  <body>
    <jsp:include page="../Template/home_top.jsp"></jsp:include>
	<div class="container">
    <div id="" class="row">
    	<div class="span9">
  			<div id="newsTitles">
	    	<s:iterator value="newsPager.data" id="anews">
	    		<div>
	    			<a href="news/news_look?id=<s:property value="#anews.id"/>"><s:property value="#anews.title"/></a> 
	    		</div>
	    	</s:iterator>
	    	<s:if test="newsPager.pageCount > 1">
	    	<div class="pagination">
			  <ul>
			  	<li><a href="news/news_getPagerNews?pagenow=1">第一页</a></li>
			  	<s:if test="newsPager.noPrev == false">
			    	<li><a href="news/news_getPagerNews?pagenow=<s:property value="newsPager.pagenow-1"/>">前一页</a></li>
			    </s:if>
			    <s:if test="newsPager.pagenow <= 4">
			    	<s:if test="newsPager.pageCount < 7">
			    	   <s:bean name="org.apache.struts2.util.Counter" id="counter">   
					   <s:param name="first" value="1" />
					   <s:param name="last" value="newsPager.pageCount" />					   
					   <s:iterator>   
					    	<s:if test="%{current-1==newsPager.pagenow}">
					    		<li class="active"><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:if> 
					    	<s:else>
					    		<li><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:else>
					   </s:iterator>   
					   </s:bean>
					</s:if>
					<s:else>
					   <s:bean name="org.apache.struts2.util.Counter" id="counter">   
					   <s:param name="first" value="1" />
					   <s:param name="last" value="7" />					   
					   <s:iterator>   
					    	<s:if test="%{current-1==newsPager.pagenow}">
					    		<li class="active"><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:if> 
					    	<s:else>
					    		<li><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:else>
					   </s:iterator>   
						</s:bean>
					</s:else> 
			    </s:if>
			   	<s:elseif test="(newsPager.pageCount - newsPager.pagenow)<=4">
			   		<s:if test="newsPager.pageCount<7">
			   		   <s:bean name="org.apache.struts2.util.Counter" id="counter">   
					   <s:param name="first" value="1" />
					   <s:param name="last" value="newsPager.pageCount" />					   
					   <s:iterator>   
					    	<s:if test="%{current-1==newsPager.pagenow}">
					    		<li class="active"><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:if> 
					    	<s:else>
					    		<li><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:else>
					   </s:iterator>   
					   </s:bean>
			   		</s:if>
			   		<s:else>
			   		   <s:bean name="org.apache.struts2.util.Counter" id="counter">   
					   <s:param name="first" value="newsPager.pageCount-6" />
					   <s:param name="last" value="newsPager.pageCount" />					   
					   <s:iterator>   
					    	<s:if test="%{current-1==newsPager.pagenow}">
					    		<li class="active"><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:if> 
					    	<s:else>
					    		<li><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:else>
					   </s:iterator>   
					   </s:bean>
			   		</s:else>
			   	</s:elseif>
			   	<s:else>
			   		   <s:bean name="org.apache.struts2.util.Counter" id="counter">   
					   <s:param name="first" value="newsPager.pagenow-3" />
					   <s:param name="last" value="newsPager.pagenow+3" />					   
					   <s:iterator>   
					    	<s:if test="%{current-1==newsPager.pagenow}">
					    		<li class="active"><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:if> 
					    	<s:else>
					    		<li><a href="news/news_getPagerNews?pagenow=<s:property value="current-1"/>" ><s:property value="current-1"/></a></li>
					    	</s:else>
					   </s:iterator>   
					   </s:bean>
			   	</s:else>
			    <s:if test="newsPager.noNext == false">
			    	<li><a href="news/news_getPagerNews?pagenow=<s:property value="newsPager.pagenow+1"/>">后一页</a></li>
			    </s:if>
			    <li><a href="news/news_getPagerNews?pagenow=<s:property value="newsPager.pageCount"/>">尾页</a></li>
			  </ul>
			</div>
			</s:if>
	    	<!--<s:property value="newsPager"/>-->
	    	</div>
	    	<jsp:include page="../Template/home_right.jsp" />
	    </div>
	  	<div class="span3">
	            	<div class="well">
            		<div class="">
            			<h3>管理入口</h3>
            		</div>
            		<div class="">
            			<a href="member_memberCenter">用户中心</a>
	                    <br>
	                    <a href="admin/member_memberList">管理员中心</a>
            		</div>
	            		
	            </div>
    		
    </div></div>
    <jsp:include page="../Template/home_footer.jsp"/>	
  

